//
//  TMGKnownCompanyDesController.m
//  TMGold
//
//  Created by Mac on 2017/12/13.
//  Copyright © 2017年 tangmu. All rights reserved.
//

#import "TMGKnownCompanyDesController.h"
#import "TMGCompanyBackController.h"
#import "STWebViewController.h"
@interface TMGKnownCompanyDesController ()

@end

@implementation TMGKnownCompanyDesController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"公司介绍";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 100)];
    header.backgroundColor = [UIColor whiteColor];
    

    
    STMenuControl * touZiControl = [[STMenuControl alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth / 3, 80) imageName:@"js_投资背景" title:@"投资背景" titleColor:TM_firstTextColor];
    [touZiControl addTarget:self action:@selector(onSlectedControl:) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:touZiControl];
    
    STMenuControl * zhanLueControl = [[STMenuControl alloc] initWithFrame:CGRectMake(touZiControl.right, 0, UIScreenWidth / 3, 80) imageName:@"js_战略合作(1)" title:@"战略合作" titleColor:TM_firstTextColor];
    [zhanLueControl addTarget:self action:@selector(onSlectedControl:) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:zhanLueControl];
    
    STMenuControl * zhuanJiaControl = [[STMenuControl alloc] initWithFrame:CGRectMake(zhanLueControl.right, 0, UIScreenWidth / 3, 80) imageName:@"js_专家顾问" title:@"专家顾问" titleColor:TM_firstTextColor];
    [zhuanJiaControl addTarget:self action:@selector(onSlectedControl:) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:zhuanJiaControl];
    
    UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, zhuanJiaControl.bottom  + 10, UIScreenWidth, 0.5)];
    line.backgroundColor = TM_lineColor;
    [header addSubview:line];
    
    STMenuControl * ziZHiControl = [[STMenuControl alloc] initWithFrame:CGRectMake(0,zhuanJiaControl.bottom, UIScreenWidth / 3, 80) imageName:@"js_资质荣誉" title:@"资质荣誉" titleColor:TM_firstTextColor];
    [ziZHiControl addTarget:self action:@selector(onSlectedControl:) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:ziZHiControl];
    
    STMenuControl * goldControl = [[STMenuControl alloc] initWithFrame:CGRectMake(ziZHiControl.right, ziZHiControl.top, UIScreenWidth / 3, 80) imageName:@"js_黄金团队(1)" title:@"黄金团队" titleColor:TM_firstTextColor];
    [goldControl addTarget:self action:@selector(onSlectedControl:) forControlEvents:UIControlEventTouchUpInside];
    [header addSubview:goldControl];
    
    header.height = goldControl.bottom + 15;
    self.tableView.tableHeaderView =  header;
}
#pragma mark --Action Method
- (void)onSlectedControl:(STMenuControl*)control{
    
    NSString * touzibeijing = @"http://jshjkd.com/gold/public/home/web/invest.html";
    NSString * zhanluehezuo = @"http://jshjkd.com/gold/public/home/web/cooperation.html";
    NSString * zhuanjiaguwen = @"http://jshjkd.com/gold/public/home/web/expert.html";
    NSString * zizhirongyun = @"http://jshjkd.com/gold/public/home/web/honor.html";
    NSString * huangjintuandui = @"http://jshjkd.com/gold/public/home/web/team.html";

    NSString * title;
    NSString * url;
    if([control.titleLable.text isEqualToString:@"投资背景"]){
        title = @"投资背景";
        url = touzibeijing;
    }
    if([control.titleLable.text isEqualToString:@"战略合作"]){
        title = @"战略合作";
        url = zhanluehezuo;
    }
    if([control.titleLable.text isEqualToString:@"专家顾问"]){
        title = @"专家顾问";
        url = zhuanjiaguwen;
    }
    if([control.titleLable.text isEqualToString:@"资质荣誉"]){
        title = @"资质荣誉";
        url = zizhirongyun;
    }
    if([control.titleLable.text isEqualToString:@"黄金团队"]){
        title = @"黄金团队";
        url = huangjintuandui;
    }
    STWebViewController * webvc = [[STWebViewController alloc] initWithUrl:url];
    webvc.progressBackgroundColor = [UIColor whiteColor];
    webvc.progressTintColor = TM_orangeColor;
    webvc.forceTitle = title;
    [self.navigationController pushViewController:webvc animated:YES];

    
//    if ([control.titleLable.text isEqualToString:@"投资背景"]) {
//        [self.navigationController pushViewController:[TMGCompanyBackController new] animated:YES];
//    }else{
//        STWebViewController * webvc = [[STWebViewController alloc] initWithUrl:@"https://www.aliyun.com/?utm_medium=text&utm_source=bdbrand&utm_campaign=bdbrand&utm_content=se_32492"];
//        webvc.progressBackgroundColor = [UIColor whiteColor];
//        webvc.progressTintColor = TM_orangeColor;
//        webvc.forceTitle = control.titleLable.text;
//        [self.navigationController pushViewController:webvc animated:YES];
//    }
}
@end
